pcall(function()
    require("load_jhqjs")
end)
local args = {
    env = {},
    outToFile = true -- 标准 out流 输出到文件
}
jhqjs.init(arg.outToFile, arg.env)

-- local qjs = require("jhqjs")
-- qjs.init(false)

-- -- qjs.load("D:\\steam\\steamapps\\common\\Don't Starve Together\\mods\\workshop-362175979\\a.js")
-- -- qjs.load("D:/steam/steamapps/workshop/content/322330/3398774282/js/loop_event.mjs")
-- -- qjs.load("d:\\steam\\steamapps\\workshop\\content\\322330\\3398774282\\js\\main.mjs")
-- -- steam/steamapps/common/Don't Starve Together/mods/workshop-362175979/js/a.mjs
-- qjs.load("/Users/zhang/Library/Application Support/Steam/steamapps/common/Don't Starve Together/dontstarve_steam.app/Contents/mods/ipv6_connection/dist/main.js")

jhqjs.load(
    "/Users/zhang/Library/Application Support/Steam/steamapps/common/Don't Starve Together/dontstarve_steam.app/Contents/mods/3398774282/js/main.mjs")
jhqjs.load("/Users/zhang/Library/Application Support/Steam/steamapps/common/Don't Starve Together/dontstarve_steam.app/Contents/mods/ipv6_connection/dist/startServer.js")

local lop = function()
    while 1 do
        jhqjs.loop()
        coroutine.yield()
    end
end

local lopfn = coroutine.create(lop)

while 1 do
    coroutine.resume(lopfn)
end
